<script setup>
import { onMounted, ref } from 'vue'

/*
 ref:
    定义响应式数据
    获取原生标签dom
          <div>xx</div>
        a:import {ref} from 'vue'
        b:const divDom=ref(null/undefined/不写)
        c:<div ref='divDom'>xx</div>
        d:divDom.value====div的dom
    获取组件标签实例
*/
const h3Dom = ref(null)
console.log(h3Dom.value)
onMounted(() => {
  console.log(h3Dom.value)
})
</script>

<template>
  <div class="page">
    <h3 ref="h3Dom">获取dom</h3>
  </div>
</template>

<style scoped></style>
